<script>
	$(document).ready(function(){
		// onchange
		$('#kd_pt').change(function(){
			$('#kd_fakultas').load(base_url+'prosedur/getFakultasbyUniversitas/'+$('#kd_pt').val());
		});
		$('#id_tahunajaran').change(function(){
			var thn = $('#id_tahunajaran').val().split('.');
			$.post(base_url+'prosedur/getKurikulumbyTahunajaran/'+thn[0]+'/'+thn[1]).success(function(data) {
				
				$('#kd_matakuliah').load(base_url+'prosedur/getMatakuliah/'+data);
				$.get(base_url+'prosedur/getIdFakultasByProdi/'+thn[1]).success(function(result) {
					
					$('#kd_fakultas').val(result);
					$.get(base_url+'prosedur/getProdibyFakultas/'+result).success(function(res) {
						$('#kd_prodi').html(res);
						$('#kd_prodi').val(thn[1]);
					});
				});
			});
		});
		// $('#kd_kurikulum').change(function(){
			// $('#kd_matakuliah').load(base_url+'prosedur/getMatakuliah/'+$('#kd_kurikulum').val());
		// });
	});
</script>

<form id="form1" method="post" action="some_action" enctype="multipart/form-data" style="margin:10px;">
	<input type="hidden" name="kode" id="kode" value="<?=$kode?>">
	<div class="fitem">
		<label style="width:135px">Tahun Ajaran </label>: 
		<select name="id_tahunajaran" id="id_tahunajaran" style="width:280px;">
			<?=$this->mdl_prosedur->OptionTahunAjaran(array('value'=>$id_tahunajaran, 'tampilProdi' => true));?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:135px">Fakultas</label>: 
		<select id="kd_fakultas" name="kd_fakultas" disabled="disabled" style="width:200px;">
			<?=$this->mdl_prosedur->OptionFakultasByUniv(array('value'=>$kd_fakultas));?>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">Prodi</label>: 
		<select id="kd_prodi" name="kd_prodi" disabled="disabled" style="width:200px;">
			<?=$this->mdl_prosedur->OptionProdi(array('kd_fakultas'=>$kd_fakultas, 'value'=>$kd_prodi));?>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">Hari</label>: 
		<select id="id_hari" name="id_hari" style="width:100px;">
			<option value="1" <?=$id_hari=='1'?'Selected':''?>>Senin</option>
			<option value="2" <?=$id_hari=='2'?'Selected':''?>>Selasa</option>
			<option value="3" <?=$id_hari=='3'?'Selected':''?>>Rabu</option>
			<option value="4" <?=$id_hari=='4'?'Selected':''?>>Kamis</option>
			<option value="5" <?=$id_hari=='5'?'Selected':''?>>Jum'at</option>
			<option value="6" <?=$id_hari=='6'?'Selected':''?>>Sabtu</option>
			<option value="0" <?=$id_hari=='0'?'Selected':''?>>Minggu</option>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">Jam Kuliah</label>: 
		<input name="JamMulai" value="<?=$JamMulai?>" size="7" maxlength="5"> s/d <input name="JamSelesai" value="<?=$JamSelesai?>" size="7" maxlength="5">
	</div>
	<!--div class="fitem">
		<label style="width:135px;">Kurikulum</label>: 
		<input id="kd_kurikulum" name="kd_kurikulum" style="width:200px;"/>
		<select id="kd_kurikulum" name="kd_kurikulum" style="width:200px;">
			<?=$this->mdl_prosedur->OptionKurikulum(array('kd_prodi'=>$kd_prodi, 'value'=>$kd_kurikulum));?>
		</select>
	</div-->
	<div class="fitem">
		<label style="width:135px;">Mata Kuliah</label>: 
		<select id="kd_matakuliah" name="kd_matakuliah" style="width:280px;">
			<?=$this->mdl_prosedur->OptionMatakuliah(array('kd_kurikulum'=>$kd_kurikulum, 'value'=>$kd_matakuliah));?>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">Nama Kelas</label>: 
		<input name="kd_kelas" value="<?=$kd_kelas?>" size="30">
	</div>
	<div class="fitem">
		<label style="width:135px;">Jenis Jadwal</label>: 
		<select id="kd_jenisjadwal" name="kd_jenisjadwal" style="width:200px;">
			<?=$this->mdl_prosedur->OptionJenisJadwal(array('value'=>$kd_jenisjadwal));?>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">SKS</label>: 
		<input name="SKS" value="<?=$SKS?>" size="7" maxlength="2"> Isikan dengan -1 jika jumlah SKS menggunakan SKS asli dari matakuliah.
	</div>
	<div class="fitem">
		<label style="width:135px;">Ruang</label>: 
		<select id="kd_ruang" name="kd_ruang" style="width:200px;">
			<?=$this->mdl_prosedur->OptionRuang(array('value'=>$kd_ruang));?>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">Dosen Pengampu</label>: 
		<select id="kd_dosen" name="kd_dosen" style="width:280px;">
			<?=$this->mdl_prosedur->OptionDosen(array('value'=>$kd_dosen));?>
		</select>
	</div>
	<div class="fitem">
		<label style="width:135px;">Rencana tatap Muka</label>: 
		<input name="RencanaKehadiran" value="<?=$RencanaKehadiran?>" size="7" maxlength="2">
	</div>
	<div class="fitem">
		<label style="width:135px;">Minimal Kehadiran Mhs</label>: 
		<input name="KehadiranMin" value="<?=$KehadiranMin?>" size="7" maxlength="2">
	</div>
</form>

	

